#pragma once

class CTTRegisterClient :
	public Client,ConnectionListener,RegistrationHandler
{
public:
	CTTRegisterClient(const JID& jid,const string& password,int port=-1);
	~CTTRegisterClient(void);

public:
	//conn
	virtual void onConnect();
	virtual void onDisconnect( enum gloox::ConnectionError );
	virtual bool onTLSConnect( const struct gloox::CertInfo& );

	//reg
	virtual void handleRegistrationFields( const JID& from, int fields,
                                             std::string instructions );
	virtual void handleAlreadyRegistered( const JID& from );
	virtual void handleRegistrationResult( const JID& from, RegistrationResult regResult );
	virtual void handleDataForm( const JID& from, const DataForm &form );
	virtual void handleOOB( const JID& from, const OOB& oob );

public:
	virtual bool handleNormalNode( Stanza *stanza );

	void SetNotifyWnd(HWND hNotifyWnd);
	void SetRegisterInfo(TTChatGlobal::LPTTRegistionInfo pRegInfo);

private:
	Registration* m_reg;
	HWND m_hNoticeWnd;
	TTChatGlobal::LPTTRegistionInfo m_pRegister;
};
